//
//  DetailViewController.swift
//  serverMonitor
//
//  Created by joke on 16/1/5.
//  Copyright © 2016年 joke. All rights reserved.
//

import UIKit
import SwiftyJSON

class DetailViewController: UIViewController {
    
    @IBOutlet weak var upTime: UILabel!
    @IBOutlet weak var systemTime: UILabel!
    @IBOutlet weak var cpuCore: UILabel!
    @IBOutlet weak var cpuModel: UILabel!
    @IBOutlet weak var load: UILabel!
    @IBOutlet weak var diskDt: UILabel!
    @IBOutlet weak var diskDf: UILabel!
    @IBOutlet weak var diskDu: UILabel!
    @IBOutlet weak var memoryDt: UILabel!
    @IBOutlet weak var memoryDf: UILabel!
    @IBOutlet weak var memoryDu: UILabel!
    @IBOutlet weak var cacheDt: UILabel!
    @IBOutlet weak var cacheDf: UILabel!
    @IBOutlet weak var cacheDu: UILabel!
    
    var detail = MonitorDetail()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        cpuModel.lineBreakMode = .ByWordWrapping
        cpuModel.numberOfLines = 5
        cpuModel.sizeToFit()
//        print(self.detail)
//        print(self.detail.upTime)
        
        self.upTime.text = self.detail.upTime!
        self.systemTime.text = self.detail.systemTime
        self.cpuCore.text = self.detail.cpuCore
        self.cpuModel.text = self.detail.cpuModel
        self.load.text = self.detail.load
        self.diskDt.text = self.detail.diskDt
        self.diskDf.text = self.detail.diskDf
        self.diskDu.text = self.detail.diskDu
        self.memoryDf.text = self.detail.memoryFree
        self.memoryDt.text = self.detail.memoryTotal
        self.memoryDu.text = self.detail.memoryUsed
        self.cacheDt.text = self.detail.memoryCached
        self.cacheDf.text = self.detail.memoryRealFree
        self.cacheDu.text = self.detail.memoryRealUsed
        
        // Do any additional setup after loading the view.
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
        // Get the new view controller using segue.destinationViewController.
        // Pass the selected object to the new view controller.
    }
    */

}
